import request from '@/utils/request.js'

// 菜单权限管理-菜单权限列表
export const getRuleList = page => {
  return request({
    url: `/rule/${page}`
  })
}

// 菜单权限管理-增加菜单权限
export const createRule = data => {
  return request({
    url: '/rule',
    method: 'post',
    data
  })
}

// 菜单权限管理-修改菜单权限
export const updateRule = (id, data) => {
  return request({
    url: `/rule/${id}`,
    method: 'post',
    data
  })
}

// 菜单权限管理-修改菜单权限状态
export const updateRuleStatus = (id, status) => {
  return request({
    url: `/rule/${id}/update_status`,
    method: 'post',
    data: { status },
  })
}

// 菜单权限管理-删除菜单权限
export const deleteRole = id => {
  return request({
    url: `/rule/${id}/delete`,
    method: 'post'
  })
}